﻿<div>
	<div data-ng-repeat="image in images.pageItems" class="image-container">
		<div class="image-item"
			data-ng-mouseenter="image.showButtons=true"
			data-ng-mouseleave="image.showButtons=false">
			<div>
				<div style="display: inline-block">
					<img class="image" data-ng-dblclick="viewImage(image)"
						data-ng-src="/api/image/getthumb/{{image.Id}}" />
					<div class="name-div">
						<div class="image-name" data-ng-hide="image.editingName">{{image.Name}}</div>
						<div class="image-name" data-ng-show="image.editingName">
							<input data-ng-model="image.newName" />
							<a class="action-link" data-ng-click="submitRenameImage(image)">
								<img src="../../../Content/images/save.png" />Save</a>
							<a class="action-link" data-ng-click="undoRenameImage(image)">
								<img src="../../../Content/images/undo.png" />Cancel</a>
						</div>
						<div class="image-name" data-ng-show="image.deletingImage">
							<span style="display: block;">Delete Image?</span>
							<a class="action-link" data-ng-click="submitDeleteImage(image)">
								<img src="../../../Content/images/delete.png" />Yes</a>
							<a class="action-link" data-ng-click="undoDeleteImage(image)">
								<img src="../../../Content/images/undo.png" />No</a>
						</div>
						<div class="image-name" data-ng-show="image.movingImage">
							<span style="display: block;">Move to: {{model.newFolderName}}?</span>
							<a class="action-link" data-ng-click="submitMoveImage(image)">
								<img src="../../../Content/images/save.png" />Save</a>
							<a class="action-link" data-ng-click="undoMovingImage(image)">
								<img src="../../../Content/images/undo.png" />Cancel</a>
						</div>
					</div>
				</div>
				<div class="image-buttons">
					<a href="/#/search/image/10/{{image.Id}}">
						<img class="img-icon" src="../../../Content/images/search.png" /></a>
					<img class="img-icon" src="../../../Content/images/favorite_add.png" data-ng-hide="isImageAFavorite(image.Id)"
						data-ng-click="setImageAsFavorite(image.Id)" />
					<img class="img-icon" src="../../../Content/images/favorite_selected.png" data-ng-show="isImageAFavorite(image.Id)"
						data-ng-click="removeImageAsFavorite(image.Id)" />
					<div style="display: block;" data-ng-hide="isViewingFavorites()">
						<img class="img-icon" src="../../../Content/images/locked2.png" data-ng-show="image.IsFolderPrivate" />
						<img class="img-icon" src="../../../Content/images/locked2.png" data-ng-show="image.IsPrivate && !image.IsFolderPrivate"
							data-ng-click="unlockImage(image)" />
						<img class="img-icon" src="../../../Content/images/unlocked2.png" data-ng-hide="image.IsFolderPrivate || image.IsPrivate"
							data-ng-click="lockImage(image)" />
					</div>
					<div style="display: inline-block;" data-ng-show="showEditButtons(image)">
						<img class="img-icon" src="../../../Content/images/moveToFolder.png"
							data-ng-click="beginMovingImage(image)" />
						<img class="img-icon" src="../../../Content/images/renameImage.png"
							data-ng-click="beginRenameImage(image);" />
						<img class="img-icon" src="../../../Content/images/delete.png"
							data-ng-click="beginDeleteImage(image)" />
					</div>
				</div>
			</div>
		</div>
	</div>
	<div>
		<button data-ng-click="images.previousPage()" data-ng-show="images.paging.number>1">Previous Page</button>
		<button data-ng-click="images.nextPage()" data-ng-show="images.paging.number<images.paging.total">Next Page</button>
	</div>
	<p data-ng-show="imageModel.isLoading"><i>Loading...</i></p>
	<p data-ng-show="images.items.length === 0 && imageModel.noItemsMessage.length>0"><i>{{imageModel.noItemsMessage}}</i></p>
</div>
